Imports System
Imports System.Configuration
Imports System.Data.SqlClient
Imports System.Data.SqlTypes
Imports System.Reflection

Namespace RTP.RSSFeed

    Public Class RSSDB

        Private Sub ExecuteSQL(ByRef SQL_Connection As SqlConnection, ByRef SQL_Command As SqlCommand)
            SQL_Connection.Open()
            SQL_Command.ExecuteNonQuery()
            SQL_Connection.Close()
        End Sub

        Public Function GetRows(ByVal txtSQLQuery As String) As SqlDataReader

            ' Create Instance of Connection and Command Object
            Dim myConnection As New SqlConnection(ConfigurationManager.AppSettings("SiteSqlServer"))

            ' Generate Command Object based on Method
            Dim mycommand As New SqlCommand(txtSQLQuery, myConnection)

            ' Execute the command
            myConnection.Open()
            Dim result As SqlDataReader = mycommand.ExecuteReader(CommandBehavior.CloseConnection)

            ' Return the datareader 
            Return result
        End Function

    End Class
End Namespace